﻿namespace TetrisProject.GameObjects.Blocks
{
    using System;

    public class BlockZ : GameObject
    {
        private static bool[,] imageHorizontal = new bool[,] 
        {
            { true, true, false },
            { false, true, true }
        };

        private static bool[,] imageVertical = new bool[,] 
        {
            { false, true },
            { true, true },
            { true, false }
        };

        private bool vertical;

        public BlockZ(int coordY)
            : base(coordY, imageHorizontal)
        {
            this.vertical = false;
        }

        public override void Rotate()
        {
            if (this.vertical)
            {
                this.body = BlockZ.imageHorizontal;
            }
            else
            {
                this.body = BlockZ.imageVertical;
            }

            this.vertical = !this.vertical;
        }
    }
}
